<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="Bookmark" href="/favicon.ico">
	<link rel="Shortcut Icon" href="/favicon.ico" />
	<!--[if lt IE 9]>
	<script type="text/javascript" src="__UU__/lib/html5.js"></script>
	<script type="text/javascript" src="__UU__/lib/respond.min.js"></script>
	<script type="text/javascript" src="__UU__/lib/PIE_IE678.js"></script>
	<![endif]-->
	<link href="__UU__/css/H-ui.min.css" rel="stylesheet" type="text/css" />
	<link href="__UU__/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
	<link href="__UU__/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
	<link href="__UU__/css/style.css" rel="stylesheet" type="text/css" /> 
	<link rel="stylesheet" type="text/css" href="__UU__/lib/bootstrap-Switch/bootstrapSwitch.css"/>
	<link href="__UU__/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
	<!--时间插件  -->
	<link rel="stylesheet" type="text/css" href="__TT__/css/time.css">
    <link rel="stylesheet" type="text/css" href="__TT__/dist/bootstrap-clockpicker.min.css">
	<!--[if IE 6]>
	<script type="text/javascript" src="__UU__/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
	<script>DD_belatedPNG.fix('*');</script>
	<![endif]-->
	<title>活动详细</title>
	<style>
		.edit-div img {
		    max-width: 450px;
		}
    </style>
</head>
<body>
	<div class="pd-20">
		<div id="tab-system" class="HuiTab">
		<form action="__APP__/Activity/save_activity" method="post" class="form form-horizontal" id="form1">
			<div class="tabBar cl"><span>基础情况</span><span>活动详情</span><span>时间/费用</span><span>购买限制</span></div>
			<div class="tabCon" style="position: relative;">
				    <input type="hidden" name="id" value="{$va.id}"/>
				    <input type="hidden" name="photo" value="{$va.photo}" id="photohidden"/>
				    <input type="hidden" name="basc_photo" id="fengmian" value="{$va.basc_photo}" />
				    <input type="hidden" name="close" id="closethis" value=""/>
				     <input type="hidden" name="callback" value="<php>echo urldecode($_GET['callback'])</php>"/>
					<div class="row cl">
						<label class="form-label col-2">活动名称：</label>
						<div class="formControls col-10">
							<input type="text" name="name" id="" datatype="*" class="input-text" value="{$va.name}" maxlength="100" style="width:450px"/>
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-2">活动分类：</label>
						<div class="formControls col-3">
							<span class="select-box">
								<select name="class_id" class="select" >
									<volist name="classlist" id="co">
										<option value="{$co.id}" <if condition="$va['class_id'] eq $co['id']">selected="selected"</if>>{$co.name}</option>
									</volist>
								</select>
							</span>
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-2">活动图片：</label>
						<div class="formControls col-10">
							<ul id="fenfd">
							    <if condition="$va.photo neq null">
							    <volist name="va['photolist']" id="vv">
							        <li>
							        <img src="{$vv}" alt="" style="width:120px;">
							        <if condition="$vv eq $va['basc_photo']">
							        <button class="btn btn-danger-outline radius size-MINI fong disabled" type="button">封面</button> 
							        <else/>
							        <button class="btn btn-danger-outline radius size-MINI fong " type="button">设为封面</button> 
							        </if>
							        <button class="btn btn-primary-outline radius size-MINI remove" type="button" data-msg="{$vv}">删除</button>
							        </li>
							    </volist>
							    </if>
							</ul>
							<if condition="$va.close neq '1' and $va.close neq '3' and $va.close neq '0'">
							<button type="button" class="btn bnt-small btn-secondary-outline radius" onclick="layer_show('更改logo','__APP__/reuse/uploadimagesfile/type/6/page/1')"> 上传</button>
							</if>
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-2">短描述：</label>
						<div class="formControls col-10">
							<input type="text" name="small_description" id="" datatype="*" class="input-text" value="{$va.small_description}" maxlength="50" style="width:250px"/>
						</div>
					</div>
					<!-- <div class="row cl">
						<label class="form-label col-2">组织机构：</label>
						<div class="formControls col-10">
							<input type="text" name="organization" id="" class="input-text" value="{$va.organization}"/>
						</div>
					</div> -->
					<div class="row cl">
						<label class="form-label col-2">活动标签：</label>
						<div class="formControls col-10">
						   <div id="ashow">
								<if condition="$labellist neq null">
								<volist name="labellist" id="ao">
								<span data-bind="{$ao.id}">{$ao.name} <i class="Hui-iconfont "></i></span>
								</volist>
								</if>
							</div>
							<input type="hidden" name="label" id="labeled" value="{$va.label}" />
							<button type="button" id="setLabel" class="btn bnt-small btn-secondary-outline radius mt-10"> 选择</button>
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-2">区域 ：</label>
						<div class="formControls col-10">
							<span class="select-box inline">
							<select name="provinceid" id="province" class="select" onchange="selectchange('__APP__/Reuse/selectcity','province','city','__APP__/Reuse/selectcircle')">
							    <option value="">请选择</option>
							    <volist name="list" id="vo">
								<option value="{$vo.id}" <if condition="$va['provinceid'] eq $vo['id']">selected="selected"</if>>{$vo.name}</option>
								</volist>
							</select></span>省
							<span class="select-box inline">
							<select name="cityid" id="city" class="select" onchange="selectchange('__APP__/Reuse/selectcity','city','area','__APP__/Reuse/selectcircle')">
							<if condition="$va.cityid neq null">
							    <option value="{$va.cityid}">{$va.cityname}</option>
							</if>
							</select>
							</span>市
							<span class="select-box inline">
							<select name="areaid" id="area" class="select" onchange="selectcircle('__APP__/Reuse/selectcircle','area')">
							<if condition="$va.areaid neq null">
							    <option value="{$va.areaid}">{$va.areaname}</option>
							</if>
							</select>
							</span>区 
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-2">商圈：</label>
						<div class="formControls col-10">
							<span class="select-box inline">
								<select name="circle_id" id="circle_id" class='select'>
								<if condition="$va.circle_id neq null">
								    <option value="{$va.circle_id}">{$va.circlename}</option>
								</if>
								</select>
							</span>
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-2">活动场地：</label>
						<div class="formControls col-10">
							<input type="text" name="place" id="" class="input-text" datatype="*" value="{$va.place}" style="width:250px"/>
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-2">活动地址：</label>
						<div class="formControls col-5">
							<input type="text" name="address" id="address" datatype="*" class="input-text" value="{$va.address}" style="width:250px"/>
							<button type="button" class="btn btn-primary radius" id="scre">搜索</button>	
						</div>
					</div>
					<input type="hidden" name="east" id="east" class="input-text" datatype="*" style="width: 300px;" <if condition="$va.north neq null">value="{$va.east},{$va.north}"</if>/>
					<!--<div class="row cl">
					    <label class="form-label col-2">坐 标：</label>
					    <div class="formControls col-5" style="position: relative;">
					    	
							<input type="text" name="east" id="" class="input-text" datatype="*" style="width: 300px;" <if condition="$va.north neq null">value="{$va.east},{$va.north}"</if>/>
						    <a href="javascript:void(0)" id="getCoord" >获取坐标</a>
					    	
					    </div>
					</div>-->
					<div class="row cl">
						<div class="col-2">&nbsp;</div>
						<div class="col-10">
							<div class="mapWrap">
								<div id="map"></div>
								<div class="mapbtn">
									<div class="showAdd">
										<ul>
											<li class="tip" style="font-size: 14px;">
												<p>请填写好省、市、区、活动地址，再按搜索，会列出最接近您的坐标位置</p>
												<p>在列表中选择相应的地址再按<span style="color:red">设定</span>按钮</p>
											</li>
										</ul>
									</div>
									<div style="text-align: center; padding-top: 10px;border-top：1px solid #ddd">
										<button type="button" class="btn btn-danger radius" id="reloadCoords">刷新</button>
										<button type="button" class="btn btn-primary radius" id="enterCoords"> 设定</button>
									</div>
								</div>
							</div>
						</div>
					</div>
					
					<div class="row cl">
						<label class="form-label col-2">联系电话：</label>
						<div class="formControls col-10">
							<input type="text" name="phone" id="" class="input-text" value="{$va.phone}" style="width:250px" maxlength="13"/>
						</div>
					</div>
			</div>
			<div class="tabCon">
					<div class="row cl">
						<label class="form-label col-2">活动介绍：</label>
						<div class="formControls col-10">
							<div>
								<button type="button" class="btn btn-primary radius rt-insert-title" id="small-title">插入小标题</button>
								<button type="button" class="btn btn-primary radius rt-insert-image" id="thumg" onclick="layer_show('上传图片','__APP__/reuse/uploadimagesfile/type/6/page/2')">插入图片</button>
							</div>
							<div contenteditable="true" class="edit-div mt-20" id="rt-editor">
								{$va.body}
							</div>
							<input type="hidden" name="body" id="editValue"  value="{$va.body}"/>
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-2">参与须知：</label>
						<div class="formControls col-10">
							<textarea name="apply_notice" class="textarea">{$va.apply_notice}</textarea>
						</div>
					</div>
			</div>
			<div class="tabCon">
					<div class="row cl">
						<label class="form-label col-2">费用类型：</label>
						<div class="formControls col-10 skin-minimal2">
							<div class="radio-box">
					          	<input type="radio" id="fee-1" name="fee_type" checked="checked" value="1">
					          	<label for="fee-1">收费</label>
					        </div>
					        <div class="radio-box">
					          	<input type="radio" id="fee-2" name="fee_type" value="2" <if condition="$va.fee_type eq '2'">checked="checked"</if>>
					          	<label for="fee-2">免费</label>
					        </div>
					        <!-- <div class="radio-box">
					          	<input type="radio" id="fee-3" name="fee_type" value="3" <if condition="$va.fee_type eq '3'">checked="checked"</if>>
					          	<label for="fee-3">外链</label>
					        </div> -->
						</div>
					</div>
					<div class="row wailian" <if condition="$va.fee_type neq '3'">style="display:none"</if>>
						<div class="row cl">
							<label class="form-label col-2">外链地址：</label>
							<div class="formControls col-10">
								<input type="text" name="url" id="" class="input-text" value="{$va.url}"/>
							</div>
						</div>
						<div class="row cl">
							<label class="form-label col-2">活动时间：</label>
							<div class="formControls col-10">
								<input type="text" datatype="*" name="wai_activity_start_date" onfocus="WdatePicker({minDate:'%y-%M-%d',maxDate:'2250-10-01'})" style="width: 180px;" class="input-text Wdate" value="{$va.activity_start_date}"/>
								-
								<input type="text" datatype="*" name="wai_activity_end_date" onfocus="WdatePicker({minDate:'%y-%M-%d',maxDate:'2250-10-01'})" style="width: 180px;" class="input-text Wdate" value="{$va.activity_end_date}"/>
								<p class="tang-tip">注：如果是单个日期，起始和结束日期设置为同一天即可</p>
							</div>
						</div>
						<div class="row cl">
							<label class="form-label col-2">活动费用：</label>
							<div class="formControls col-10">
								<input type="text" name="activity_money" style="width: 180px;" datatype="n" class="input-text"  value="{$va.activity_money}"/>
								-
								<input type="text" name="activity_end_money" style="width: 180px;" datatype="n"  class="input-text"  value="{$va.activity_end_money}"/>
								<p class="tang-tip">注：此处不需输入货币符号（如果是单个价格，最低和最高价格设置为同一数值即可）</p>
							</div>
						</div>
					</div>
					<div class="row shoufei" <if condition="$va.fee_type eq '3'">style="display:none"</if>>
						<div class="row cl">
							<label class="form-label col-2">退款类型：</label>
							<div class="formControls col-10 skin-minimal">
								<div class="radio-box">
						          	<input type="radio" id="retreat-1" name="retreat_type" checked="checked" value="1">
						          	<label for="retreat-1">可退</label>
						        </div>
						        <div class="radio-box">
						          	<input type="radio" id="retreat-2" name="retreat_type" value="2" <if condition="$va.retreat_type eq '2'">checked="checked"</if>>
						          	<label for="retreat-2">不可退</label>
						        </div>
							</div>
						</div>
						<div class="row cl">
							<label class="form-label col-2">预约类型：</label>
							<div class="formControls col-10 skin-minimal">
								<div class="radio-box">
						          	<input type="radio" id="retreat-55" name="order_type" <if condition="$va.order_type eq '1' or $va eq null">checked="checked"</if> value="1">
						          	<label for="retreat-55">在线选择场次</label>
						        </div>
						        <div class="radio-box">
						          	<input type="radio" id="retreat-66" name="order_type" value="2" <if condition="$va.order_type eq '2'">checked="checked"</if>/>
						          	<label for="retreat-66">电话预约</label>
						        </div>
							</div>
						</div>
						<div class="row cl">
							<label class="form-label col-2">时间类型：</label>
							<div class="formControls col-5">
								<span class="select-box">
									<select name="time_type" id="setype" class="select">
										<option value="0">--请选择--</option>
										<option value="1" <if condition="$va.time_type eq '1'">selected="selected"</if>>单个日期</option>
										<option value="2" <if condition="$va.time_type eq '2'">selected="selected"</if>>按周重复</option>
										<option value="3" <if condition="$va.time_type eq '3'">selected="selected"</if>>连续日期</option>
										<option value="4" <if condition="$va.time_type eq '4'">selected="selected"</if>>长期举办</option>
									</select>
								</span>
							</div>
						</div>
						<div class="row cl" id="fd" <if condition="$va.field eq null">style='display: none;'</if>>
							<label class="form-label col-2">&nbsp;</label>
							<div class="formControls col-10">
								<button type="button" class="btn bnt-small btn-secondary-outline radius" onclick="add_chang()">增加场次</button>
							</div>
						</div>
						<div id="session-bar">
							<!--场次-->
							<include file="Reuse:changci"/>	
						</div>
					</div>
					
			</div>
			<div class="tabCon" style="padding-bottom:25px;">
					<div class="row cl">
						<label class="form-label col-2">&nbsp;</label>
						<div class="formControls col-10 skin-minimal">
							<div class="radio-box">
					          	<input type="radio" id="buy-1" name="buy_limit" value="1" <if condition="$va.buy_limit eq '1' or $va.buy_limit eq null">checked="checked"</if>>
					          	<label for="buy-1">活动结束前均可购买</label>
					        </div> 
					        <br /><br />
					        <div class="radio-box">
					          	<input type="radio" id="buy-2" name="buy_limit" value="2" <if condition="$va.buy_limit eq '2'">checked="checked"</if>>
					          	<label for="buy-2">活动开始前 <input type="text" value="{$va.before_time}" class="input-text" style="width: 50px;" name="before_time" id="" />小时可购买，之后不购买</label>
					        </div>
					        <br /> <br />
					        <div class="radio-box">
					          	<input type="radio" id="buy-3" name="buy_limit" value="3" <if condition="$va.buy_limit eq '3'">checked="checked"</if>>
					          	<label for="buy-3">
					          		指定时间 <input type="text" name="appoint_start_time" id="njd" style="width: 120px;" class="input-text Wdate" onfocus="WdatePicker({minDate:'%y-%M-%d',maxDate:'2110-01-01'})" value="{$va.appoint_start_time}"/>
					          		-
					          		<input type="text" name="appoint_end_time" id="njd2" style="width: 120px;" class="input-text Wdate" onfocus="WdatePicker({minDate:'1990-01-01'})" value="{$va.appoint_end_time}"/>
					          	</label>
					        </div>
						</div>
					</div>
					
					<div class="row cl">
						<label class="form-label col-2">收集信息：</label>
					<div class="formControls col-10 customd">
						<div class="radio-box">
							<input type="radio" id="getter1" name="is_collect_information" value="1" <if condition="$va.is_collect_information eq '1'">checked="checked"</if>/>
						    <label for="getter1">是</label>
						</div>
						<div class="radio-box">
							<input type="radio" id="getter2" <if condition="$va.is_collect_information eq '0' or $va.is_collect_information eq null">checked="checked"</if> name="is_collect_information" value="0" />
						    <label for="getter2">否</label>
						</div>
					</div>
					</div>
					<style>
						#msg-selected .radio-box{
							margin-bottom: 10px;
						}
						#custom-msg{
							border-bottom: 1px solid #DDD;
							padding-bottom: 10px;
						}
						#custom-msg .input-text{
							margin-top: 10px;
						}
						#msgBox{
							display: none;
						}
					</style>
					<div class="row cl" id="msgBox" <if condition="$va.is_collect_information eq '1'">style="display:block;"</if>>
					<label class="form-label col-2">&nbsp;</label>
					<div class="formControls col-10 skin-minimal" id="msg-selected" >

						<div class="radio-box">
							<input type="checkbox" name="information_title[]" id="user_name" value="真实姓名" <if condition="in_array('真实姓名',$va['information_title']['information_title'])">checked="checked"</if>/>
							<label for="user_name">真实姓名</label>
						</div>
						<div class="radio-box">
							<input type="checkbox" name="information_title[]" id="user_mobile" value="手机" <if condition="in_array('手机',$va['information_title']['information_title'])">checked="checked"</if>/>
							<label for="user_mobile">手机</label>
						</div>
						<div class="radio-box">
							<input type="checkbox" name="information_title[]" id="user_email" value="邮箱" <if condition="in_array('邮箱',$va['information_title']['information_title'])">checked="checked"</if>/>
							<label for="user_email">邮箱</label>
						</div>
						<div class="radio-box">
							<input type="checkbox" name="information_title[]" id="user_company" value="公司" <if condition="in_array('公司',$va['information_title']['information_title'])">checked="checked"</if>/>
							<label for="user_company">公司</label>
						</div>
						<div class="radio-box">
							<input type="checkbox" name="information_title[]" id="user_department" value="部门" <if condition="in_array('部门',$va['information_title']['information_title'])">checked="checked"</if>/>
							<label for="user_department">部门</label>
						</div>
						<div class="radio-box">
							<input type="checkbox" name="information_title[]" id="user_post" value="职位" <if condition="in_array('职位',$va['information_title']['information_title'])">checked="checked"</if>/>
							<label for="user_post">职位</label>
						</div>
						<div class="radio-box">
							<input type="checkbox" name="information_title[]" id="user_sex" value="性别" <if condition="in_array('性别',$va['information_title']['information_title'])">checked="checked"</if>/>
							<label for="user_sex">性别</label>
						</div>
						<div class="radio-box">
							<input type="checkbox" name="information_title[]" id="user_birthday" value="生日" <if condition="in_array('生日',$va['information_title']['information_title'])">checked="checked"</if>/>
							<label for="user_birthday">生日</label>
						</div>
						<div class="radio-box">
							<input type="checkbox" name="information_title[]" id="user_back" value="学历" <if condition="in_array('学历',$va['information_title']['information_title'])">checked="checked"</if>/>
							<label for="user_back">学历</label>
						</div>
						<div class="radio-box">
							<input type="checkbox" name="information_title[]" id="user_interest" value="兴趣爱好" <if condition="in_array('兴趣爱好',$va['information_title']['information_title'])">checked="checked"</if>/>
							<label for="user_interest">兴趣爱好</label>
						</div>
						<div class="radio-box">
							<input type="checkbox" name="information_title[]" id="user_accessory" value="附件" <if condition="in_array('附件',$va['information_title']['information_title'])">checked="checked"</if>/>
							<label for="user_accessory">
								附件
								<input type="text" name="accessory_name[]" placeholder="附件提示文字" style="display:inline;width:100px" class="input-text" id="" value="{$va['information_title']['accessory_name'][0]}"/>
							</label>
						</div>
						

						<div><button type="button" id="add_custom" class="btn btn-warning radius btn-xs"><i class="Hui-iconfont">&#xe600;</i></button><span class="tang-tip"> 注：自定义仅支持文本输入框</span></div>
						<div id="custom-msg">
							<!-- 接收字段  custom_msg[] --> 
							<if condition="$va['information_title']['order_title'] neq null">
							<volist name="va['information_title']['order_title']" id="tt">
								<if condition="$tt neq null">
								   <input type="text" class="input-text" name="orther_title[]" value="{$tt}" />
								</if>
							</volist>
							</if>
						</div>
	                  </div>
					</div>
				</div>

			</div>
			<if condition="($va.close neq '1' and $va.close neq '3' and $va.close neq '0') or $_POST neq null">
			 <div class="row cl" style="padding:25px 0;">
			    <div class="col-10 col-offset-2">
					<button class="btn btn-danger radius sub" type="button">
						<i class="Hui-iconfont">&#xe632;</i> 存为草稿
					</button>
					<button class="btn btn-primary radius sub" type="button">
						<i class="Hui-iconfont">&#xe632;</i> 提交审核
					</button>
					<button type="button" class="btn btn-success radius sub">
						<i class="Hui-iconfont">&#xe709;</i>预览
					</button>
				</div>
			 </div>
			 </if>
			</form>
		</div>
	</div>

<!--  长期举办-->
<script type="text/html" id="se-temp4">

	<div class="session-on">
        <input type="hidden" name="field_id[]" value=""/>
		<div class="row cl">
			<label class="form-label col-2"><strong>场次{n}&nbsp;&nbsp;</strong></label>
			<a class="formControls" onclick="del_div(this)" href="javascript:void(0)" style="text-decoration:none;display: inline-block;" >
                  <i class="Hui-iconfont">&#xe6e2;</i>
            </a>
		</div>
		<div class="row cl">
			<label class="form-label col-2">&nbsp;</label>
			<div class="formControls col-10 skin-minimal">
				<div class="radio-box">
		          	<input type="checkbox" id="nore{n}" name="is_order[]"  value="1" />
		          	<label for="nore{n}">具体以预约时间为准</label>
		        </div>
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-2">活动频率：</label>
			<div class="formControls col-10 skin-minimal">
				<div class="check-box">
					<input type="checkbox" id="week1-{n}" name="week{n}[]" value="1"/>
					<label for="week1-{n}">周一</label>
				</div>
				<div class="check-box">
					<input type="checkbox" id="week2-{n}" name="week{n}[]" value="2"/>
					<label for="week2-{n}">周二</label>
				</div>
				<div class="check-box">
					<input type="checkbox" id="week3-{n}" name="week{n}[]" value="3"/> 
					<label for="week3-{n}">周三</label>
				</div>
				<div class="check-box">
					<input type="checkbox" id="week4-{n}" name="week{n}[]" value="4"/>
					<label for="week4-{n}">周四</label>
				</div>
				<div class="check-box">
					<input type="checkbox" id="week5-{n}" name="week{n}[]" value="5"/>
					<label for="week5-{n}">周五</label>
				</div>
				<div class="check-box">
					<input type="checkbox" id="week6-{n}" name="week{n}[]" value="6" />
					<label for="week6-{n}">周六</label>
				</div>
				<div class="check-box">
					<input type="checkbox" id="week7-{n}" name="week{n}[]" value="0" />
					<label for="week7-{n}">周日</label>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">活动时间：</label>
			<div class="formControls col-10">
				<input type="text" name="activity_start_time[]" datatype="*" id="logmin-{n}" placeholder="开始时间" class="input-text Wdate clockpicker"  style="width:180px" />
				-
				<input type="text" name="activity_end_time[]" datatype="*" id="logmax-{n}" placeholder="结束时间" class="input-text Wdate clockpicker"  style="width:180px" />
			</div>
		</div>
</script>
<!--按周重复-->
<script type="text/html" id="se-temp3">
	<div class="session-on">
        <input type="hidden" name="field_id[]" value=""/>
		<div class="row cl">
			<label class="form-label col-2"><strong>场次{n}&nbsp;&nbsp;</strong></label>
			<a class="formControls" onclick="del_div(this)" href="javascript:void(0)" style="text-decoration:none;display: inline-block;" >
                  <i class="Hui-iconfont">&#xe6e2;</i>
            </a>
		</div>
		<div class="row cl">
			<label class="form-label col-2">&nbsp;</label>
			<div class="formControls col-10 skin-minimal">
				<div class="radio-box">
		          	<input type="checkbox" id="nore{n}" name="is_order[]"  value="1" />
		          	<label for="nore{n}">具体以预约时间为准</label>
		        </div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">活动日期：</label>
			<div class="formControls col-10">
				<input type="text" name="activity_start_date[]" datatype="*" id="mind-{n}" placeholder="开始日期" style="width: 180px" class="input-text Wdate" onfocus="WdatePicker({minDate:'%y-%M-%d',maxDate:'2250-10-01'})" />
				-
				<input type="text" name="activity_end_date[]" datatype="*" id="maxd-{n}" placeholder="结束日期" style="width: 180px" class="input-text Wdate" onfocus="WdatePicker({minDate:'1990-01-01'})" />
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">活动频率：</label>
			<div class="formControls col-10 skin-minimal">
				<div class="check-box">
					<input type="checkbox" id="week1-{n}" name="week{n}[]" value="1"/>
					<label for="week1-{n}">周一</label>
				</div>
				<div class="check-box">
					<input type="checkbox" id="week2-{n}" name="week{n}[]" value="2"/>
					<label for="week2-{n}">周二</label>
				</div>
				<div class="check-box">
					<input type="checkbox" id="week3-{n}" name="week{n}[]" value="3"/> 
					<label for="week3-{n}">周三</label>
				</div>
				<div class="check-box">
					<input type="checkbox" id="week4-{n}" name="week{n}[]" value="4"/>
					<label for="week4-{n}">周四</label>
				</div>
				<div class="check-box">
					<input type="checkbox" id="week5-{n}" name="week{n}[]" value="5"/>
					<label for="week5-{n}">周五</label>
				</div>
				<div class="check-box">
					<input type="checkbox" id="week6-{n}" name="week{n}[]"  value="6"/>
					<label for="week6-{n}">周六</label>
				</div>
				<div class="check-box">
					<input type="checkbox" id="week7-{n}" name="week{n}[]"  value="0"/>
					<label for="week7-{n}">周日</label>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">活动时间：</label>
			<div class="formControls col-10">
				<input type="text" name="activity_start_time[]" datatype="*" id="logmin-{n}" placeholder="开始时间" class="input-text Wdate clockpicker"  style="width:180px" />
				-
				<input type="text" name="activity_end_time[]" datatype="*" id="logmax-{n}" placeholder="结束时间" class="input-text Wdate clockpicker"  style="width:180px" />
			</div>
		</div>
</script>
<!--连续日期-->
<script type="text/html" id="se-temp2">
<div class="session-on">
    <input type="hidden" name="field_id[]" value=""/>
	<div class="row cl">
		<label class="form-label col-2"><strong>场次{n}&nbsp;&nbsp;</strong></label>
		<a class="formControls" onclick="del_div(this)" href="javascript:void(0)" style="text-decoration:none;display: inline-block;" >
                  <i class="Hui-iconfont">&#xe6e2;</i>
            </a>
	</div>
	<div class="row cl">
			<label class="form-label col-2">&nbsp;</label>
			<div class="formControls col-10 skin-minimal">
				<div class="radio-box">
		          	<input type="checkbox" id="nore{n}" name="is_order[]"  value="1" />
		          	<label for="nore{n}">具体以预约时间为准</label>
		        </div>
			</div>
		</div>
	<div class="row cl">
		<label class="form-label col-2">活动日期：</label>
		<div class="formControls col-10">
			<input type="text" name="activity_start_date[]" id="mind-{n}" datatype="*" placeholder="开始日期" style="width: 180px" class="input-text Wdate" onfocus="WdatePicker({minDate:'%y-%M-%d',maxDate:'2555-01-01'})" />
			-
			<input type="text" name="activity_end_date[]" id="maxd-{n}" datatype="*" placeholder="结束日期" style="width: 180px" class="input-text Wdate" onfocus="WdatePicker({minDate:'1990-01-01'})" />
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-2">活动时间：</label>
		<div class="formControls col-10">
			<input type="text" name="activity_start_time[]" datatype="*" id="logmin-{n}" placeholder="开始时间" class="input-text Wdate clockpicker"  style="width:180px" />
			-
			<input type="text" name="activity_end_time[]" datatype="*" id="logmax-{n}" placeholder="结束时间" class="input-text Wdate clockpicker"  style="width:180px" />
		</div>
	</div>
</script>
<!--单个日期-->
<script type="text/html" id="se-temp">
<div class="session-on">
    <input type="hidden" name="field_id[]" value=""/>
	<div class="row cl">
		<label class="form-label col-2"><strong>场次{n}&nbsp;&nbsp;</strong>
		</label>
		<a class="formControls" onclick="del_div(this)" href="javascript:void(0)" style="text-decoration:none;display: inline-block;" >
                  <i class="Hui-iconfont">&#xe6e2;</i>
            </a>
	</div>
	<div class="row cl">
			<label class="form-label col-2">&nbsp;</label>
			<div class="formControls col-10 skin-minimal">
				<div class="radio-box">
		          	<input type="checkbox" id="nore{n}" name="is_order[]"  value="1" />
		          	<label for="nore{n}">具体以预约时间为准</label>
		        </div>
			</div>
		</div>
	<div class="row cl">
		<label class="form-label col-2">活动日期：</label>
		<div class="formControls col-10">
			<input type="text" name="activity_start_date[]" datatype="*" id="" placeholder="开始日期" class="input-text Wdate" onfocus="WdatePicker({minDate:'%y-%M-%d'})" />
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-2">活动时间：</label>
		<div class="formControls col-10">
			<input type="text" name="activity_start_time[]" datatype="*" id="logmin-{n}" placeholder="开始时间" class="input-text Wdate clockpicker"  style="width:180px" />
			-
			<input type="text" name="activity_end_time[]" datatype="*" id="logmax-{n}" placeholder="结束时间" class="input-text Wdate clockpicker"  style="width:180px" />
		</div>
	</div>
</script>
<!--票-->
<script type="text/html" id="se-piao">
<div class="row cl" data-chang="{n}">
		<label class="form-label col-2">票价类型：</label>
		<div class="formControls col-10">
			<table class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
						<th width="130px">票名</th>
						<th width="90px">现价</th>
						<th width="90px">原价</th>
						<th width="60px">数量</th>
						<th width="150px">限购</th>
						<th>说明</th>
						<th width="30px">操作</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						
						<td><input type="text" name="ticket_name{n}[]" id="" class="input-text" datatype="*" placeholder="如成人票..." /></td>
						<td><input type="text" name="true_price{n}[]" id="" datatype="*" class="input-text" /></td>
						<td><input type="text" name="old_price{n}[]" id="" datatype="*" value="0" class="input-text" placeholder="没有请填0" /></td>
						<td><input type="text" name="number{n}[]"  class="input-text" datatype="*" /></td>
						<td>
							<input type="text" name="ticket_limit{n}[]" id="" class="input-text" datatype="*" placeholder="单个用户可预订数量" />
						</td>
						<td><input type="text" name="ticket_explain{n}[]" id="" class="input-text" placeholder="针对该价格的说明信息" /></td>
						<td>
                             <input type="hidden" name="ticket_id{n}[]" value=""/>
							<a title="删除" href="javascript:;" class="ml-5" style="text-decoration:none" onclick="del_tr(this)"><i class="Hui-iconfont">&#xe6e2;</i></a>
						</td>
					</tr>
				</tbody>
			</table>
			<div class="text-c mt-20">
				<button type="button" class="btn btn-primary radius" onclick="add_piao(this)">增加票种</button>
			</div>
		</div>
	</div>
</div>


</script>
<script type="text/javascript" src="__UU__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__UU__/lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript" src="__UU__/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="__UU__/js/H-ui.js"></script>
<script type="text/javascript" src="__UU__/js/H-ui.admin.js"></script>	
<script src="__UU__/lib/bootstrap-Switch/bootstrapSwitch.js"></script>	
<script type="text/javascript" src="__UU__/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="__ADMIN__/js/function.js?w=124444"></script>
<script type="text/javascript" src="__ADMIN__/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=385af75901e4311aa28de8963d939c11"></script>
<!--时间插件  -->
<script type="text/javascript" src="__TT__/dist/bootstrap-clockpicker.min.js"></script>
<script src="__ADMIN__/js/jquery.dialog.js"></script>
<link rel="stylesheet" href="__ADMIN__/js/ui-dialog.css" />
<script src="__ADMIN__/js/plupload.full.min.js"></script>
<script src="__ADMIN__/js/rangy-core.min.js"></script>
<script src="__ADMIN__/js/rangy-selectionsaverestore.min.js"></script>
<script src="__ADMIN__/js/qiniu.js"></script>
<script src="__ADMIN__/js/edit.js"></script>
<script type="text/javascript">
var co = $('#east').val() || "116.404516,39.914907";
co = co.split(',');
var map = new BMap.Map("map", {enableMapClick:false});
	var point = new BMap.Point(co[0], co[1]);
	map.centerAndZoom(point,18);
	map.enableScrollWheelZoom(true);
	var marker = new BMap.Marker(point);  // 创建标注
	map.addOverlay(marker);
$('#scre').click(function() {
	var province = $('#province').val(),
		city = $('#city').val(),
		area = $('#area').val(),
		address = $('#address').val();
	
	if( !province || !city || !area || !address ){
		layer.msg("请把省市区和地址填写完整");
		return false;
	}
	city = $('#city').find('option:selected').text();
	area = $('#area').find('option:selected').text();
	province = $('#province').find('option:selected').text();
	map.clearOverlays();
	var local = new BMap.LocalSearch(map, {
		renderOptions:{map: map, autoViewport:false, selectFirstResult:false, highlightMode:false},
		onSearchComplete:function(result) {
			$('.showAdd ul').empty();
			var a = result.wr;
			var str = '';
			for(var index in a){
				var f = (parseInt(index)+1);
				if( index == 0 ){
					centerMap(a[index].point)
				}
				str += '<li data-coord="'+a[index].point.lng + ',' + a[index].point.lat +'">';
				str += '<span class="ion_'+f+'"></span><div class="ion_text">';
				str += '<p><b>'+a[index].title+'</b></p><p>'+a[index].address+'</p></div></li>';
			}
			$('.showAdd ul').append(str);
			$('.showAdd ul li').eq(0).addClass('active');
			$('#east').val($('.showAdd ul li').eq(0).attr('data-coord'));
		}
	});
	local.search(city + area + address);
	
});
function centerMap(coord) {
	map.setCenter(coord);
}
$('#reloadCoords').click(function() {
	layer.confirm('刷新会使当前坐标重新获取，并将第一个坐标设为你的默认坐标',{icon: 2, title:'Eventor'},function(index) {
		$('#scre').trigger('click');
		layer.close(index);
	});
	
})
$('.showAdd ul').on('click', 'li', function() {
	var coord = $(this).attr('data-coord');
	coord = coord.split(',');
	var point = new BMap.Point(coord[0], coord[1]);
	centerMap(point);
	$(this).addClass('active').siblings().removeClass('active');
});
$('#enterCoords').click(function() {
	var oli = $('.showAdd ul').find('li.active');
	layer.confirm('您确定使用该座标吗？', {icon: 3, title:'Eventor'}, function(index) {
//		$('.mapWrap').hide();
		var coord = oli.attr('data-coord');
		$('#east').val(coord);
		layer.close(index);
		layer.msg('设定成功');
	});
})





$('.clockpicker').clockpicker();
var chang = <php>echo count($va['field'])?count($va['field']):'0'</php>,vTypd = {$va['time_type']?$va['time_type']:'0'};
var bar = $('#se-piao').html();
function initCheckbox(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
}
layer.config({
    extend: 'extend/layer.ext.js'
});
$(function (){
	initCheckbox();
	$.Huitab("#tab-system .tabBar span","#tab-system .tabCon","current","click","0");

	$('.skin-minimal2 input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	}).change(function (){
		if( this.value == 3 ){
			$('.wailian').show();
			$('.shoufei').hide();
		}else{
			$('.wailian').hide();
			$('.shoufei').show();
		}
	})
	//场次
	$('#setype').change(function (){
		vTypd = parseInt(this.value)
		chang = 1;
		vTypd == 0? ($('#fd').hide()) : ($('#fd').show());
		var temp = switchType(vTypd);
		$('#session-bar').empty();
		$('#session-bar').html( temp + bar.replace(/\{n\}/g,chang) );
		initCheckbox();
		$('.clockpicker').clockpicker();
	});
	// $('#small-title').click(function (){
	// 	var l = layer.prompt({
	// 		    title: '输入小标题',
	// 		    formType: 0 //prompt风格，支持0-2
	// 	},function (ds){
	// 		ds && insertDiv('text', ds);
	// 		layer.close(l)
	// 	})
	// });


	// 设封面
	$('#fenfd').on('click','.fong',function (){
		if( $(this).hasClass('disabled') ){
			return ;
		}
		$(this).parent().siblings('li').find('.fong').each(function (){
			$(this).removeClass('btn-danger-outline disabled').addClass('btn-primary-outline');
		})
		$(this).removeClass('btn-primary-outline').addClass('btn-danger-outline disabled');
		$('#fengmian').val( $(this).siblings('img').attr('src') );
	});
	//删除
	$('#fenfd').on('click','.remove',function (){
		var photo = $("#photohidden");
		var msg = $(this).attr('data-msg');
		var arr = [];
		photo.val().split(',').forEach(function (item){
			if( item != msg ){
				arr.push(item);
			}
		})
		photo.val(arr.join(','));
		$(this).parent().remove();
		if($('#fengmian').val() == msg){
			var oli = $('#fenfd li').eq(0);
			$('#fengmian').val(oli.find('img').attr('src'));
			oli.find('.fong').removeClass('btn-primary-outline').addClass('btn-danger-outline disabled').text('封面');
			
		}
	});

	//设置标签
	$('#setLabel').click(function (){
		var label = $('#labeled').val();
		if( label == "" ){
			layer_show('设置标签','__APP__/reuse/setlabel');
		}else{
			layer_show('设置标签','__APP__/reuse/setlabel?id=' + label);
		}
	});
	//提交、存草稿
	
  $(".sub").each(function(k){
    $(this).click(function(){
      if(k==2){
    	  $('#form1').attr("action","__APP__/Activity/save_yulan_activity");
    	  $("#form1").submit();
      }else{
    	  $('#form1').attr("action","__APP__/Activity/save_activity");
    	  layer.confirm('你确定要执行此操作吗？',{
	  			btn:['确定','取消']
	  	  },function(){
	  		  if(k == 0){
	  			  $("#closethis").val(4)
	  		  }else{
	  			  $("#closethis").val(0)
	  		  }
	  		  $(".form").submit();
	  	  })
      }
	  
	});
  });

		$('#add_custom').click(function() {
		var customBox = $('#custom-msg');
		customBox.append('<input type="text" class="input-text" name="orther_title[]" placeholder="请输入资料标题" />');
	});

	$('.customd input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	}).change(function() {
		if( this.value == 1 ){
			$('#msgBox').show();
		}else{
			$('#msgBox').hide();
		}
	});


});
// 保存标签
function interestCallback (data){
	var label = $('#labeled');
	var ashow = $('#ashow');
	var hideValue = "";
	ashow.empty();
	data.forEach(function (item){
		var v = item.split('_');
		hideValue += v[0] + ",";
		ashow.append( '<span data-bind='+v[0]+'>'+v[1]+' <i class="Hui-iconfont ">&#xe6a6;</i></span>' )
	});
	//if( label.val() == '' ){
		label.val(hideValue);
	//}else{
		//label.val( label.val() + hideValue );
	//}
}
//删除某个标签,也删除其ID
$('#ashow').on('click','i',function (){
	var par = $(this).parent();
	var aid = par.attr('data-bind');
	var ahide = $('#labeled').val().split(','),arr = [];
	ahide.forEach(function (item){
		if( aid != item ){
			arr.push(item);
		}
	})
	$('#labeled').val( arr.join(',') );
	par.remove();
});
function appendImg(data){
	var fen = $('#fenfd');
	var fenliLen = fen.find('li').length;
	var str = '<li><img src=' + data.msg + ' alt="" style="width:120px;">' ;
	if( fenliLen < 1 ){
		$("#photohidden").val(data.msg);
		$('#fengmian').val(data.msg);
		str += '<button class="btn btn-danger-outline radius size-MINI fong disabled" type="button">封面</button> '
	}else{
		$("#photohidden").val($("#photohidden").val() + ',' + data.msg);
		str += '<button class="btn btn-primary-outline radius fong size-MINI" type="button">设为封面</button> ';
	}
	str += '<button class="btn btn-primary-outline radius size-MINI remove" type="button" data-msg="'+data.msg+'">删除</button></li>';
	fen.append(str);

}

function upLoadedsCallback (file, res){
	//上传回调
	if(res.code == 200){
		if(res.page == 1){
			appendImg(res)			
		}else if(res.page == 2){
			// insertDiv('image',res.msg);
			insertImage(res.msg);
		}
	}else{
		layer.alert(res.msg);
	}
}

function insertDiv (type, content){
	var editDiv = $('.edit-div');
	if( type == 'text' ){
		editDiv.append('<h3>'+content+'</h3>');
	}else if( type == 'image' ){
		var mhtml = '<p><img src="'+content+'"/></p>';
		editDiv.append(mhtml);
	}
	onkeyDiv();
}
function onkeyDiv (){
	var Dom = $('.edit-div');
	
	if( $.trim(Dom.text()) == '' && !(Dom.html().match(/img/g))  ){
		Dom.empty();
	}
	// Dom.find(":empty").each(function (){
	// 	if($(this)[0].nodeName.toUpperCase() === 'IMG' ){
			
	// 	}else{
	// 		$(this).remove();
	// 	}
		
	// });
	$("#editValue").val(Dom.html());
}

// $('.edit-div').keyup(onkeyDiv);



function switchType (v){
	var temp = null;
	switch( v ){
		case 0 :
			$('#session-bar').empty();  //清空，不可见
			 break;
		case 1 :
			temp =$('#se-temp').html();
			break;
		case 2 : 
			temp = $('#se-temp3').html();
			break;
		case 3 : 
			temp = $('#se-temp2').html();
			break;
		case 4 : 
			temp = $('#se-temp4').html();
			break;
		default:
			break;
	}
	return temp.replace(/\{n\}/g,chang);
}
function add_chang (){
	++chang;
	var temp = switchType( vTypd );
	var modeF = $('<div></div>').html( temp + bar.replace(/\{n\}/g,chang) );
	$('#session-bar').append( modeF.html() );
	modeF = null;
	initCheckbox();
	$('.clockpicker').clockpicker();
}
function add_piao (that){
	var sf = '<tr><td><input type="text" name="ticket_name{n}[]" id="" datatype="*" class="input-text" placeholder="如成人票..." /></td>';
		sf += '<td><input type="text" name="true_price{n}[]" id="" datatype="*" class="input-text" /></td><td><input type="text" name="old_price{n}[]" id="" value="0" class="input-text" /></td><td><input type="text" name="number{n}[]"  id="" datatype="*" class="input-text" /></td>';
		sf += '<td><input type="text" name="ticket_limit{n}[]" id="" datatype="*" class="input-text" placeholder="单个用户可预订数量" /></td>';
		sf += '<td><input type="text" name="ticket_explain{n}[]" id="" class="input-text" placeholder="针对该价格的说明信息" /></td><td>';
		sf += '<input type="hidden" name="ticket_id{n}[]" value=""/><a title="删除" href="javascript:;" class="ml-5" onclick="del_tr(this)" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a></td></tr>';
	var num = $(that).parents('.row').attr('data-chang');
	$(that).parent().prev('table').find('tbody').append(sf.replace(/\{n\}/g,num));
}
function del_tr (that){
	$(that).parents('tr').remove();
}
function del_div(that){
	--chang;
	$(that).parents('.session-on').remove();
}
<if condition="$va.id neq null">
layer.ready(function() {
	layer.photos({
		photos:'.layer-image'
	});
});
</if>
</script>
<script>
var fors = $('#form1').Validform({
		tiptype:3,
		ignoreHidden:true,
		tipSweep:false,
		beforeCheck:function(curform) {
			if( !fors.check() ){
				layer.msg("表单未填写完整，请检查！！");
				return false;
			}

		}
	});
</script>
</body>
</html>

